package com.xhwl.data.util;

/**
 * @Author: luyi
 * @Description: 企业项目编码等自动生成
 * @Date: Create in 11:41 2021/2/24
 */
public class AutoCodeUtils {

    public static String codeFormat(String per, Integer id, int length){
        String primeryKey = id.toString();
        StringBuilder sbd = new StringBuilder(per);

        int needLength = length - primeryKey.length();
        for(int i = needLength; i > 0; i --){
            sbd.append("0");
        }
        sbd.append(primeryKey);
        return sbd.toString();
    }
}
